import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/a.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';

class NormalChip extends StatelessWidget {
  final String title;
  final VoidCallback onClose;

  const NormalChip({Key key, this.title, this.onClose}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return PressedOpacityButton(
      onPressed: onClose,
      child: Container(
        decoration: BoxDecoration(
            color: aceWhiteGreyColor,
            borderRadius: BorderRadius.circular(getDp(30))),
        padding: EdgeInsets.only(
          left: getDp(13),
          right: getDp(5),
          top: getDp(3),
          bottom: getDp(3),
        ),
        clipBehavior: Clip.none,
        child: Row(
          mainAxisSize: MainAxisSize.min,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(
              title,
              style: TextStyle(
                color: aceDarkGrayColor,
                fontSize: getSp(16),
                fontWeight: FontWeight.w400,
                height: 1,
              ),
            ),
            PressedOpacityButton(
              padding: EdgeInsets.only(
                  left: getDp(10), right: getDp(10), top: getDp(3)),
              onPressed: onClose,
              child: Image.asset(
                A.assetsImagesStyleCloseBlack,
                width: getDp(9),
                height: getDp(9),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
